Ext.define('Emp.view.BaseEdit', {
	extend: 'Ext.window.Window',
	alias: 'widget.baseedit',
	
	title: '新&nbsp;&nbsp;建',
	//resizable: false,
	maximizable: true,
	minimizable: true,
	modal: true,
	constrain: true,
	width: 400,
	height: 300,
	layout: 'fit',
	
	isModify: false,
	isRead: false,
	createTitle: '新&nbsp;&nbsp;建',
	modifyTitle: '修&nbsp;&nbsp;改',
	readTitle: '查&nbsp;&nbsp;看',
	
	initComponent: function() {
		var me = this;
		me.buttons = [{
				xtype: 'splitbutton',
				text: '保&nbsp;&nbsp;存',
				iconCls: 'save',
				action: 'save',
				disabled: true,
				menu: {
			        items: [{
		        		text: '关&nbsp;&nbsp;闭',
						iconCls: 'close',
						action: 'save_close'
		        	}]
			    }
			}, {
				text: '新&nbsp;&nbsp;建',
				iconCls: 'create',
				action: 'create'
			}, {
				text: '关&nbsp;&nbsp;闭',
				iconCls: 'close',
				action: 'close'
		}];
		me.callParent();
		me.down('form').getForm().on('validitychange', me.onValidityChange, me);
	},
	
	onValidityChange: function(from, valid) {
		this.down('button[action=save]').setDisabled(!valid);
	}
});